
package com.yuke.cloud.service.uac.enums;


import java.util.Arrays;
import java.util.List;


/**
 * The enum Acc user status enum.
 *
 * @author
 */
public enum AccUserStatusEnum {

	/**
	 * Enable acc user status enum.
	 */
	/*
	 * 启用
	 */
	ENABLE("ENABLE", (byte)1),
	/**
	 * 禁用
	 */
	DISABLE("DISABLE",(byte)0);

	/**
	 * The Key.
	 */
	String key;
	/**
	 * The Value.
	 */
	Byte value;

	AccUserStatusEnum(String key, Byte value) {
		this.key = key;
		this.value = value;
	}

	/**
	 * Gets key.
	 *
	 * @return the key
	 */
	public String getKey() {
		return key;
	}

	/**
	 * Gets value.
	 *
	 * @return the value
	 */
	public Byte getValue() {
		return value;
	}

	/**
	 * 获取key获取value
	 *
	 * @param key key
	 *
	 * @return value value
	 */
	public static Byte getValue(String key) {
		for (AccUserStatusEnum ele : AccUserStatusEnum.values()) {
			if (key.equals(ele.getKey())) {
				return ele.getValue();
			}
		}
		return null;
	}

	/**
	 * 根据key获取该对象
	 *
	 * @param key key
	 *
	 * @return this enum
	 */
	public static AccUserStatusEnum getEnum(String key) {
		for (AccUserStatusEnum ele : AccUserStatusEnum.values()) {
			if (key.equals(ele.getKey())) {
				return ele;
			}
		}
		return null;
	}

	/**
	 * 获取List集合
	 *
	 * @return List list
	 */
	public static List<AccUserStatusEnum> getList() {
		return Arrays.asList(AccUserStatusEnum.values());
	}
}
